home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,401 to 4,500 / aol-file-protocol-4400-4401-to-4500.zip / AOLDLs / PDA-Newton Development / ND+ Add PICT to Card (NS-Basic) / NSPICT.txt < prev   
Text File  |  2014-12-08  |  2KB  |  48 lines

  1. Here's a neat hack in NS BASIC. It puts a PICT into the Notes slot of 
  2. the Names app. Now, when you beam your business card, you can have a
  3. custom designed picture, or perhaps your company logo. If you're gonna
  4. be at MacWorld, this is a great way to wow people you beam!
  5.  
  6. Note: To do this, you'll need the NTK, either the live or demo version.
  7. NS BASIC isn't strictly needed, but makes it easy.
  8.  
  9. Here's the program:
  10.  
  11. 0010 LET x=getroot().|txtxfer:NSBASIC|._proto.stepchildren[13]
  12. 0020 open ch,"Names",sortOn
  13. 0030 get ch,n,"Henne"
  14. 0050 LET n.notes=[{viewStationery: 'poly}]
  15. 0060 LET n.notes[0].viewBounds={left: 0, top: 0, right: 236, bottom: 96}
  16. 0070 LET n.notes[0]._proto=removeSlot(x,'preallocatedContext)
  17. 0080 put ch,n
  18.  
  19. How to:
  20. 1. Create your graphic in some sort of drawing program. I use HyperCard.
  21. 2. Using ResEdit, cut and paste the graphic into a resource file that's
  22. included in a project in NTK. Mine was called |txtxfer:NSBASIC|. 
  23. Make sure you've named the resource in ResEdit.
  24. 3. In your project, define a clPictureView. Set the value of the icon
  25. slot to your named resource, and download it.
  26. 4. Now, look at the stepchildren slots of your app. You can do this in
  27. NS BASIC by typing
  28.  
  29. 0010 LET x=getroot().|txtxfer:NSBASIC|._proto.stepchildren
  30. RUN
  31. VARS
  32.  
  33. See which element of stepChildren is your clPictureView.
  34. 5. Modify line 10 of the above program to name your application and
  35. address the correct element of stepChildren.
  36. 6. Modify line 30 to get your own card in Names
  37. 7. Run it!
  38.  
  39. NS BASIC has gotta be one of the neatest hacking tools around for the
  40. Newton (along with ViewFrame!)
  41.  
  42. [My thanks to Sidney Low, who first figured out how to do this]
  43.  
  44. -- 
  45. George W.P. Henne      gh@hookup.net
  46. The Eastwood Group
  47. 416 264-5777        fax 416 264-5888
  48.